/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
	const { router, controller, middleware } = app;
	const tokenAuth = middleware.tokenAuthentication();

	router.get('/api/user/mpLogin', controller.api.user.mpLogin);

	router.get("/api/user/getCode", controller.api.user.getCode);
	router.get("/api/user/phoneLogin", controller.api.user.phoneLogin)

	router.get('/api/user/userInfo', tokenAuth, controller.api.user.userInfo);
	// 根据手机号码获取业务员信息
	router.get('/api/user/salesman', tokenAuth, controller.api.user.salesman);
	// 小程序解密手机号
	router.post('/api/user/decryptPhone', tokenAuth, controller.api.user.decryptPhone);
	// 获取用户消息列表
	router.get('/api/user/message', tokenAuth, controller.api.user.message);
	// 获取是否有未读消息
	router.get('/api/user/unreadMessage', tokenAuth, controller.api.user.unreadMessage);
	// 字典
	router.get('/api/dict/:key', controller.api.user.dict);
};
